@extends('layouts.userctl')
@section('content')
<style>.layui-input, .layui-textarea { width: 95%; } .fade{opacity: 0;filter:alpha(opacity=0);}</style>
<blockquote class="layui-elem-quote">
	<a style="color:#fff;" href="{{ url('/admin/staff/index') }}" class="layui-btn layui-btn-normal layui-btn-sm" >返  回</a>	
</blockquote>

<div class="layui-form">
	<table class="layui-table">
		<colgroup>
			<col width="100">
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="150">
			<col width="150">
		</colgroup>
		<thead>
			<tr>
				<th>姓名</th>
				<th>请假开始日期</th>
				<th>请假结束日期</th>
				<th>请假理由</th>
				<th>审核状态</th>
				<th>驳回理由</th>
				<th></th>
			</tr> 
		</thead>
		<tbody>
			@foreach($leave as $l)
			<tr>
				<td>{{$l['name']['name']}}</td>
				<td>{{$l['starttime']}}</td>
				<td>{{$l['endtime']}}</td>
				<td>{{$l['reason']}}</td>
				<td>{{$l['reasons']}}</td>
				<td>{{$l['reject']}}</td>
				<td>
					@if($l['status'] == 0)
					<a class="layui-btn " href="{{route('admin.staff.examine',array('id'=>$l['id'],'status'=>1))}}"
							style="color: #fff;">通过</a>
					<button  data-method="notice" class="layui-btn tanchu" >驳回</button>
					<input type="hidden" value="{{$l['id']}}" id="cid">
					@endif
				</td>
			</tr>
			@endforeach
		</tbody>
	</table>
</div>
<!--弹出层-->
	<div class="modal fade" id="myModal">
		<div class="w1000 modal-dialog modal-dialog-l ui-draggable" role="document" >
			 <div class="modal-content content-level gaoog" >
				<link rel="stylesheet" type="text/css" href="/static/css/productShow.css">
				<div>
					<form id="dataFormPro" action="{{route('admin.staff.examine')}}" method="get"><br>
						<div class="layui-form-item">
						    <label class="layui-form-label" style="width:110px">驳回原因</label>
						    <div class="layui-input-block">
						      <input type="text" name="reject" lay-verify="title" autocomplete="off" placeholder="请输入原因" class="layui-input tan_form">
						    </div>
							
							<input type="hidden" value="2" name="status">
							<input type="hidden" value="" name="id" id="lid">
						  </div>
						  <button class="layui-btn layui-btn-normal" style="display: block; margin: 0 auto;">提交</button>
						  <br>
					</form>
				</div> 
			</div>
		</div>
	</div>
	
<script>
layui.use('layer', function(){ //独立版的layer无需执行这一句
  var $ = layui.jquery, layer = layui.layer; //独立版的layer无需执行这一句
  
  //触发事件
  var active = {
    notice: function(){
      //示范一个公告层
      layer.open({
        type: 1
        ,title: false //不显示标题栏
        ,closeBtn: false
        ,area: '700px;'
        ,shade: 0.8
        ,id: 'LAY_layuipro' //设定一个id，防止重复弹出
        ,btnAlign: 'c'
        ,moveType: 1 //拖拽模式，0或者1
        ,content: $("#myModal").html()//我要学的主要内容
        ,success: function(layero){
          // var btn = layero.find('.layui-layer-btn');
          // btn.find('.layui-layer-btn0').attr({
          //   href: 'http://www.layui.com/'
          //   ,target: '_blank'
          // });
        }
      });
    }

  };
  
  $('.tanchu').on('click', function(){
	$('#lid').val($(this).next().val());
     var othis = $(this), method = othis.data('method');
     active[method] ? active[method].call(this, othis) : '';
  });
  
});
</script>

 @endsection
          